const TOKEN_MAME='fh_token'
const CITY_TOKEN = 'fh_city'

// 获取当前定位城市
const getCity = () => JSON.parse(localStorage.getItem(CITY_TOKEN)) || {}

// 设置当前定位城市
const setCity = value => localStorage.setItem(CITY_TOKEN, value)

//获取token
function getToken(){
  return localStorage.getItem(TOKEN_MAME)
}
//设置token
function setToken(value){
  localStorage.setItem(TOKEN_MAME,value)
}
//删除token
function removeToken(){
  localStorage.removeItem(TOKEN_MAME)
}
//是否登录
function isAuth(){
  return !!getToken()
}
export {getToken,setToken,removeToken,isAuth,getCity,setCity}